from flask import Flask, render_template, request
from datetime import datetime
app = Flask(__name__)

@app.route("/index")
def index():
    text = "eee"
    ctime = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    http = """
    <h1 style="border:1px solid red;width:300px">nb网站</hi>
    """
    return render_template("index.html", n1=text, time=ctime)
@app.route("/do/reg")
def reg():
    # 获取请求参数
    user = request.args.get("user")
    return render_template("reg.html", user=user)
    return "返回成功"
@app.route("/do/for")
def do_for():
    lst = [
        {
            "name": "紫嫣",
            "sex": "女",
            "age": "19",
        },
        {
            "name": "嫣然",
            "sex": "女",
            "age": "20",
        },
        {
            "name": "萌萌",
            "sex": "女",
            "age": "18",
        }
    ]
    return render_template("do_for.html", lst=lst)
if __name__ == '__main__':
    app.run()